class RpDetailEntity {
  int code;
  Data data;
  String message;

  RpDetailEntity({
      this.code, 
      this.data, 
      this.message});

  RpDetailEntity.fromJson(dynamic json) {
    code = json["code"];
    data = json["data"] != null ? Data.fromJson(json["data"]) : null;
    message = json["message"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["code"] = code;
    if (data != null) {
      map["data"] = data.toJson();
    }
    map["message"] = message;
    return map;
  }

}

class Data {
  String clientID;
  String addTime;
  String addUser;
  int rpTypeID;
  int pharmacistOrgType;
  String section;
  String pharmacistName;
  int rpSource;
  String modifyUser;
  int clientType;
  String modifyTime;
  String medicineForm;
  String doctorTime;
  String rpFileOriginFileUrl;
  String aiResultContent;
  int recipeAllPrice;
  PatientInfo patientInfo;
  String providerName;
  int medicineFormID;
  String pharmacistStaffID;
  String clientUserID;
  String rpFileOriginFileID;
  String pharmacistID;
  String keyID;
  int feeType;
  String rpFileStampFileID;
  ChineseMedicine chineseMedicine;
  String furtherConsultDiagnosisNo;
  String aiBy;
  String aiResultTip;
  String doctorID;
  String doctorOrgID;
  List<Medicines> medicines;
  String sectionCode;
  int aiStatus;
  String enjoin;
  int providerType;
  String doctorName;
  String allergyHistory;
  String pharmacistGroupID;
  String pharmacistOrgID;
  String pharmacistTime;
  int doctorOrgType;
  String pushTime;
  int retry;
  String patientName;
  int rpStatus;
  int process;
  String distributeTime;
  String primaryDiagnosisNo;
  String patientID;
  String aiResultType;
  int pushStatus;
  int isDelete;
  int totalDoses;
  String rpFileStampFileUrl;
  String rpTypeName;
  String recordID;
  String rpImgFileID;
  String providerID;
  String registrationNo;
  String rpImgFileUrl;
  String notPassReason;
  String primaryDiagnosis;

  Data({
      this.clientID, 
      this.addTime, 
      this.addUser, 
      this.rpTypeID, 
      this.pharmacistOrgType, 
      this.section, 
      this.pharmacistName, 
      this.rpSource, 
      this.modifyUser, 
      this.clientType, 
      this.modifyTime, 
      this.medicineForm, 
      this.doctorTime, 
      this.rpFileOriginFileUrl, 
      this.aiResultContent, 
      this.recipeAllPrice, 
      this.patientInfo, 
      this.providerName, 
      this.medicineFormID, 
      this.pharmacistStaffID, 
      this.clientUserID, 
      this.rpFileOriginFileID, 
      this.pharmacistID, 
      this.keyID, 
      this.feeType, 
      this.rpFileStampFileID, 
      this.chineseMedicine, 
      this.furtherConsultDiagnosisNo, 
      this.aiBy, 
      this.aiResultTip, 
      this.doctorID, 
      this.doctorOrgID, 
      this.medicines, 
      this.sectionCode, 
      this.aiStatus, 
      this.enjoin, 
      this.providerType, 
      this.doctorName, 
      this.allergyHistory, 
      this.pharmacistGroupID, 
      this.pharmacistOrgID, 
      this.pharmacistTime, 
      this.doctorOrgType, 
      this.pushTime, 
      this.retry, 
      this.patientName, 
      this.rpStatus, 
      this.process, 
      this.distributeTime, 
      this.primaryDiagnosisNo, 
      this.patientID, 
      this.aiResultType, 
      this.pushStatus, 
      this.isDelete, 
      this.totalDoses, 
      this.rpFileStampFileUrl, 
      this.rpTypeName, 
      this.recordID, 
      this.rpImgFileID, 
      this.providerID, 
      this.registrationNo, 
      this.rpImgFileUrl, 
      this.notPassReason, 
      this.primaryDiagnosis});

  Data.fromJson(dynamic json) {
    clientID = json["clientID"];
    addTime = json["addTime"];
    addUser = json["addUser"];
    rpTypeID = json["rpTypeID"];
    pharmacistOrgType = json["pharmacistOrgType"];
    section = json["section"];
    pharmacistName = json["pharmacistName"];
    rpSource = json["rpSource"];
    modifyUser = json["modifyUser"];
    clientType = json["clientType"];
    modifyTime = json["modifyTime"];
    medicineForm = json["medicineForm"];
    doctorTime = json["doctorTime"];
    rpFileOriginFileUrl = json["rpFileOriginFileUrl"];
    aiResultContent = json["aiResultContent"];
    recipeAllPrice = json["recipeAllPrice"];
    patientInfo = json["patientInfo"] != null ? PatientInfo.fromJson(json["patientInfo"]) : null;
    providerName = json["providerName"];
    medicineFormID = json["medicineFormID"];
    pharmacistStaffID = json["pharmacistStaffID"];
    clientUserID = json["clientUserID"];
    rpFileOriginFileID = json["rpFileOriginFileID"];
    pharmacistID = json["pharmacistID"];
    keyID = json["keyID"];
    feeType = json["feeType"];
    rpFileStampFileID = json["rpFileStampFileID"];
    chineseMedicine = json["chineseMedicine"] != null ? ChineseMedicine.fromJson(json["chineseMedicine"]) : null;
    furtherConsultDiagnosisNo = json["furtherConsultDiagnosisNo"];
    aiBy = json["aiBy"];
    aiResultTip = json["aiResultTip"];
    doctorID = json["doctorID"];
    doctorOrgID = json["doctorOrgID"];
    if (json["medicines"] != null) {
      medicines = [];
      json["medicines"].forEach((v) {
        medicines.add(Medicines.fromJson(v));
      });
    }
    sectionCode = json["sectionCode"];
    aiStatus = json["aiStatus"];
    enjoin = json["enjoin"];
    providerType = json["providerType"];
    doctorName = json["doctorName"];
    allergyHistory = json["allergyHistory"];
    pharmacistGroupID = json["pharmacistGroupID"];
    pharmacistOrgID = json["pharmacistOrgID"];
    pharmacistTime = json["pharmacistTime"];
    doctorOrgType = json["doctorOrgType"];
    pushTime = json["pushTime"];
    retry = json["retry"];
    patientName = json["patientName"];
    rpStatus = json["rpStatus"];
    process = json["process"];
    distributeTime = json["distributeTime"];
    primaryDiagnosisNo = json["primaryDiagnosisNo"];
    patientID = json["patientID"];
    aiResultType = json["aiResultType"];
    pushStatus = json["pushStatus"];
    isDelete = json["isDelete"];
    totalDoses = json["totalDoses"];
    rpFileStampFileUrl = json["rpFileStampFileUrl"];
    rpTypeName = json["rpTypeName"];
    recordID = json["recordID"];
    rpImgFileID = json["rpImgFileID"];
    providerID = json["providerID"];
    registrationNo = json["registrationNo"];
    rpImgFileUrl = json["rpImgFileUrl"];
    notPassReason = json["notPassReason"];
    primaryDiagnosis = json["primaryDiagnosis"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["clientID"] = clientID;
    map["addTime"] = addTime;
    map["addUser"] = addUser;
    map["rpTypeID"] = rpTypeID;
    map["pharmacistOrgType"] = pharmacistOrgType;
    map["section"] = section;
    map["pharmacistName"] = pharmacistName;
    map["rpSource"] = rpSource;
    map["modifyUser"] = modifyUser;
    map["clientType"] = clientType;
    map["modifyTime"] = modifyTime;
    map["medicineForm"] = medicineForm;
    map["doctorTime"] = doctorTime;
    map["rpFileOriginFileUrl"] = rpFileOriginFileUrl;
    map["aiResultContent"] = aiResultContent;
    map["recipeAllPrice"] = recipeAllPrice;
    if (patientInfo != null) {
      map["patientInfo"] = patientInfo.toJson();
    }
    map["providerName"] = providerName;
    map["medicineFormID"] = medicineFormID;
    map["pharmacistStaffID"] = pharmacistStaffID;
    map["clientUserID"] = clientUserID;
    map["rpFileOriginFileID"] = rpFileOriginFileID;
    map["pharmacistID"] = pharmacistID;
    map["keyID"] = keyID;
    map["feeType"] = feeType;
    map["rpFileStampFileID"] = rpFileStampFileID;
    if (chineseMedicine != null) {
      map["chineseMedicine"] = chineseMedicine.toJson();
    }
    map["furtherConsultDiagnosisNo"] = furtherConsultDiagnosisNo;
    map["aiBy"] = aiBy;
    map["aiResultTip"] = aiResultTip;
    map["doctorID"] = doctorID;
    map["doctorOrgID"] = doctorOrgID;
    if (medicines != null) {
      map["medicines"] = medicines.map((v) => v.toJson()).toList();
    }
    map["sectionCode"] = sectionCode;
    map["aiStatus"] = aiStatus;
    map["enjoin"] = enjoin;
    map["providerType"] = providerType;
    map["doctorName"] = doctorName;
    map["allergyHistory"] = allergyHistory;
    map["pharmacistGroupID"] = pharmacistGroupID;
    map["pharmacistOrgID"] = pharmacistOrgID;
    map["pharmacistTime"] = pharmacistTime;
    map["doctorOrgType"] = doctorOrgType;
    map["pushTime"] = pushTime;
    map["retry"] = retry;
    map["patientName"] = patientName;
    map["rpStatus"] = rpStatus;
    map["process"] = process;
    map["distributeTime"] = distributeTime;
    map["primaryDiagnosisNo"] = primaryDiagnosisNo;
    map["patientID"] = patientID;
    map["aiResultType"] = aiResultType;
    map["pushStatus"] = pushStatus;
    map["isDelete"] = isDelete;
    map["totalDoses"] = totalDoses;
    map["rpFileStampFileUrl"] = rpFileStampFileUrl;
    map["rpTypeName"] = rpTypeName;
    map["recordID"] = recordID;
    map["rpImgFileID"] = rpImgFileID;
    map["providerID"] = providerID;
    map["registrationNo"] = registrationNo;
    map["rpImgFileUrl"] = rpImgFileUrl;
    map["notPassReason"] = notPassReason;
    map["primaryDiagnosis"] = primaryDiagnosis;
    return map;
  }

}

class Medicines {
  String drugPackage;
  String drugCode;
  String takeFrequence;
  String medicineID;
  String memo;
  String takeDose;
  int medicineClassID;
  int course;
  double unitPrice;
  String formType;
  String goodsID;
  String medicineClassName;
  int isDelete;
  String keyID;
  String specification;
  String takeDirection;
  String rpID;
  String medicineName;
  String recordID;
  int medicationDays;
  int medicineAmount;
  String unit;

  Medicines({
      this.drugPackage, 
      this.drugCode, 
      this.takeFrequence, 
      this.medicineID, 
      this.memo, 
      this.takeDose, 
      this.medicineClassID, 
      this.course, 
      this.unitPrice, 
      this.formType, 
      this.goodsID, 
      this.medicineClassName, 
      this.isDelete, 
      this.keyID, 
      this.specification, 
      this.takeDirection, 
      this.rpID, 
      this.medicineName, 
      this.recordID, 
      this.medicationDays, 
      this.medicineAmount, 
      this.unit});

  Medicines.fromJson(dynamic json) {
    drugPackage = json["drugPackage"];
    drugCode = json["drugCode"];
    takeFrequence = json["takeFrequence"];
    medicineID = json["medicineID"];
    memo = json["memo"];
    takeDose = json["takeDose"];
    medicineClassID = json["medicineClassID"];
    course = json["course"];
    unitPrice = json["unitPrice"];
    formType = json["formType"];
    goodsID = json["goodsID"];
    medicineClassName = json["medicineClassName"];
    isDelete = json["isDelete"];
    keyID = json["keyID"];
    specification = json["specification"];
    takeDirection = json["takeDirection"];
    rpID = json["rpID"];
    medicineName = json["medicineName"];
    recordID = json["recordID"];
    medicationDays = json["medicationDays"];
    medicineAmount = json["medicineAmount"];
    unit = json["unit"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["drugPackage"] = drugPackage;
    map["drugCode"] = drugCode;
    map["takeFrequence"] = takeFrequence;
    map["medicineID"] = medicineID;
    map["memo"] = memo;
    map["takeDose"] = takeDose;
    map["medicineClassID"] = medicineClassID;
    map["course"] = course;
    map["unitPrice"] = unitPrice;
    map["formType"] = formType;
    map["goodsID"] = goodsID;
    map["medicineClassName"] = medicineClassName;
    map["isDelete"] = isDelete;
    map["keyID"] = keyID;
    map["specification"] = specification;
    map["takeDirection"] = takeDirection;
    map["rpID"] = rpID;
    map["medicineName"] = medicineName;
    map["recordID"] = recordID;
    map["medicationDays"] = medicationDays;
    map["medicineAmount"] = medicineAmount;
    map["unit"] = unit;
    return map;
  }

}

class ChineseMedicine {
  int isDelete;
  String keyID;
  String everyDose;
  int frequence;
  String rpID;
  String direction;

  ChineseMedicine({
      this.isDelete, 
      this.keyID, 
      this.everyDose, 
      this.frequence, 
      this.rpID, 
      this.direction});

  ChineseMedicine.fromJson(dynamic json) {
    isDelete = json["isDelete"];
    keyID = json["keyID"];
    everyDose = json["everyDose"];
    frequence = json["frequence"];
    rpID = json["rpID"];
    direction = json["direction"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["isDelete"] = isDelete;
    map["keyID"] = keyID;
    map["everyDose"] = everyDose;
    map["frequence"] = frequence;
    map["rpID"] = rpID;
    map["direction"] = direction;
    return map;
  }

}

class PatientInfo {
  int patientSex;
  String crowd;
  String allergyDetail;
  String historyOfSickness;
  String diseaseDiff;
  String guardianName;
  String illDesc;
  String patientAge;
  String sicknessDetail;
  String patientName;
  String guardianIdcardNum;
  String liver;
  int isDelete;
  String pregnancy;
  String keyID;
  String patientPhone;
  String patientIdNo;
  String syndromeDiff;
  double patientWeight;
  String renal;
  String historyOfAllergy;
  int idNoType;

  PatientInfo({
      this.patientSex, 
      this.crowd, 
      this.allergyDetail, 
      this.historyOfSickness, 
      this.diseaseDiff, 
      this.guardianName, 
      this.illDesc, 
      this.patientAge, 
      this.sicknessDetail, 
      this.patientName, 
      this.guardianIdcardNum, 
      this.liver, 
      this.isDelete, 
      this.pregnancy, 
      this.keyID, 
      this.patientPhone, 
      this.patientIdNo, 
      this.syndromeDiff, 
      this.patientWeight, 
      this.renal, 
      this.historyOfAllergy, 
      this.idNoType});

  PatientInfo.fromJson(dynamic json) {
    patientSex = json["patientSex"];
    crowd = json["crowd"];
    allergyDetail = json["allergyDetail"];
    historyOfSickness = json["historyOfSickness"];
    diseaseDiff = json["diseaseDiff"];
    guardianName = json["guardianName"];
    illDesc = json["illDesc"];
    patientAge = json["patientAge"];
    sicknessDetail = json["sicknessDetail"];
    patientName = json["patientName"];
    guardianIdcardNum = json["guardianIdcardNum"];
    liver = json["liver"];
    isDelete = json["isDelete"];
    pregnancy = json["pregnancy"];
    keyID = json["keyID"];
    patientPhone = json["patientPhone"];
    patientIdNo = json["patientIdNo"];
    syndromeDiff = json["syndromeDiff"];
    patientWeight = json["patientWeight"];
    renal = json["renal"];
    historyOfAllergy = json["historyOfAllergy"];
    idNoType = json["idNoType"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["patientSex"] = patientSex;
    map["crowd"] = crowd;
    map["allergyDetail"] = allergyDetail;
    map["historyOfSickness"] = historyOfSickness;
    map["diseaseDiff"] = diseaseDiff;
    map["guardianName"] = guardianName;
    map["illDesc"] = illDesc;
    map["patientAge"] = patientAge;
    map["sicknessDetail"] = sicknessDetail;
    map["patientName"] = patientName;
    map["guardianIdcardNum"] = guardianIdcardNum;
    map["liver"] = liver;
    map["isDelete"] = isDelete;
    map["pregnancy"] = pregnancy;
    map["keyID"] = keyID;
    map["patientPhone"] = patientPhone;
    map["patientIdNo"] = patientIdNo;
    map["syndromeDiff"] = syndromeDiff;
    map["patientWeight"] = patientWeight;
    map["renal"] = renal;
    map["historyOfAllergy"] = historyOfAllergy;
    map["idNoType"] = idNoType;
    return map;
  }

}